//    Copyright (C) Kherty.  All rights reserved.
namespace OpenLS.Drawing.Internals
{
    public static class EmuConverter
    {
        /*public static double FromEmu(double d)
        {
            return PointsToPixelConverter.ToPixel(d / 12700);
        }*/

        public static double FromEmu(long d)
        {
            return PointsToPixelConverter.ToPixel((double)d / 12700);
        }
        public static double? FromEmu(long? d)
        {
            if (d == null)
                return null;
            return PointsToPixelConverter.ToPixel((double)d.Value / 12700);
        }

        public static long ToEmu(double d)
        {
            return (long)PointsToPixelConverter.ToPoint(d * 12700);
        }
        public static long? ToEmu(double? d)
        {
            if (d == null)
                return null;
            return ToEmu(d.Value);
            //return PointsToPixelConverter.ToPoint(d.Value * 12700);
        }
    }
}